package com.tengol.demo.design.pattern.creational.prototype.simple;

import java.text.MessageFormat;

/**
 * 邮件发送工具
 *
 * @author dongrui
 * @date 2019/03/01
 */
public class MailUtil {
    public static void sendMail(MailTemplate mail) {
        String content = "中奖同学：{0}，邮件地址：{1}，邮件内容：{2}，发送邮件成功！";
        System.out.println(MessageFormat.format(content, mail.getName(), mail.getEmailAddress(), mail.getContent()));
    }

    public static void saveOriginMail(MailTemplate mail){
        System.out.println("存储Origin邮件记录：Origin邮件：" + mail.getContent());
    }
}
